<?php 

require_once 'Zend/Controller/Action/Helper/Redirector.php';

class Okute_Controller_Action_Helper_Redirector extends Zend_Controller_Action_Helper_Redirector
{
    const SESSION_KEY = 'PHPSESSID';
    
    public function redirectWithSession($url)
    {
        $param = null;
        $request = $this->getRequest();
        $cookie = $request->getCookie();
        if (! isset($cookie[$this::SESSION_KEY])) {
            $param = '?' . $this::SESSION_KEY . '=' . Zend_Session::getId();
        }
        $this->_redirect($url . $param);
        $this->getResponse()->sendHeaders();
        exit();
    }
}